﻿
@model IEnumerable<MiniBlog.Core.ViewModels.ListView.ListPictureViewModel>

@{
    ViewData["Title"] = "图片管理";
}
<h4>Pictures</h4>
<table class="table">
    <thead>
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.Small)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Big)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.CreateTime)
            </th>
            <th>
                <a asp-controller="Home" asp-action="Picture">上传图片</a>
            </th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model)
        {
        <tr>
            <td>
                @{
                    var index= item.Small.LastIndexOf("\\");
                    var img = item.Small.Substring(index+1);

                    var bigIndex = item.Big.LastIndexOf("\\");
                    var bigImg = item.Big.Substring(bigIndex+1);
                }
                <img src="/@img" style="height:50px;" />
            </td>
            <td>
                <img src="/@bigImg" style="height:50px;" />
            </td>
            <td>
                @item.CreateTime
            </td>
            <td>
                @Html.ActionLink("删除", "DeletePicture", new { id = item.Id })
            </td>
        </tr>
        }
    </tbody>
</table>
<pager option="ViewBag.Options" action-url="/Home/Pictures"></pager>